home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
cgazv4n3.zip
/
PACK.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-29
|
1KB
|
34 lines
/********************** PACK.C --- LISTING 3 *******************
* Driver program to test the PACK3 and UNPACK3 routines.
*
* Author : Bob Zigon
* Date : June 9, 1989
********************************************************************/
#include "string.h"
#include "stdio.h"
/*******************************************************************
* Function Prototypes
********************************************************************/
short int Pack3(char *InBuf, short int NumChars, char *OutBuf);
short int UnPack3(char *InBuf, short int NumChars, char *OutBuf);
char TestString[] = "Abcdefg1234567890-+=.,$#@!%^& $";
char Buffer[50];
char UnBuffer[50];
void main()
{
short int UnPackLen, PackLen;
printf("\nPacking ...");
PackLen = Pack3(TestString, strlen(TestString), Buffer);
printf("\nUnPacking ...");
UnPackLen = UnPack3(Buffer, PackLen, UnBuffer);
printf("\n\nPackLen = %d UnPackLen = %d", PackLen, UnPackLen);
printf("\n\n>%s< %d\n>%s<", TestString, strlen(TestString), UnBuffer);
}